//
//  FirstCollectionViewCell.m
//  DownMenu
//
//  Created by 赵国栋 on 16/7/16.
//  Copyright © 2016年 zhaoguodong. All rights reserved.
//



#define KLABLECENTER   _lable.center
#import "FirstCollectionViewCell.h"

@implementation FirstCollectionViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    [self creatView];
    return self;
}


//创建btn
- (UIButton *)creatBtnWithframe:(CGRect)frame alpha:(float)alpha backImage:(NSString *)backImage{
    
    UIButton *btn = [[UIButton alloc]initWithFrame:frame];
    btn.alpha = alpha;
    if (backImage != nil) {
        UIImage *image = [UIImage imageNamed:backImage];
        UIImageView *vi = [[UIImageView alloc]initWithFrame:CGRectMake(40, 20, 20, 25)];
        vi.image = image;
        [btn addSubview:vi];
    }
    return btn;
}

- (void)creatView{
    
    _image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,KSCREENWIDTH, 200)];
    _image.userInteractionEnabled = YES;
    _image.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:_image];
    
    _lable = [[UILabel alloc]init];
    _lable.frame = CGRectMake(27, KCELLHEIGHT-60, 150, 40);
    _lable.font =[UIFont fontWithName:@"Arial" size:16];
    _lable.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_lable];
    
    _watherBtn = [[UIButton alloc]initWithFrame:CGRectMake(13, KCELLHEIGHT-25, 100, 20)];
    [_watherBtn setTitle:@"正在获取天气..." forState:UIControlStateNormal];
    _watherBtn.titleLabel.font = [UIFont fontWithName:@"Arial" size:12];
    [self.contentView addSubview:_watherBtn];
    
    _picBtn = [self creatBtnWithframe:CGRectMake(KSCREENWIDTH-100,KCELLHEIGHT-75, 100, 50) alpha:1 backImage:@"btnpic.png"];
    _picBtn.titleLabel.font =[UIFont fontWithName:@"Arial" size:13];
    _picBtn.titleEdgeInsets = UIEdgeInsetsMake(70, 0, 0, 0);
    [_picBtn setTitle:@"景区图" forState:UIControlStateNormal];
    [self.contentView addSubview:_picBtn];
    //分割线
    _dividerLable = [[UILabel alloc]initWithFrame:CGRectMake(KSCREENWIDTH-85, KCELLHEIGHT-60, 1, 50)];
    _dividerLable.backgroundColor =[UIColor whiteColor];
    _dividerLable.alpha =  0.7;
    [self.contentView addSubview:_dividerLable];
    
    _introduceBtn = [self creatBtnWithframe:CGRectMake(KSCREENWIDTH-170,KCELLHEIGHT-75, 100, 50) alpha:1 backImage:@"jieshao.png"];
    _introduceBtn.titleLabel.font =[UIFont fontWithName:@"Arial" size:13];
    _introduceBtn.titleEdgeInsets = UIEdgeInsetsMake(70, 0, 0, 0);
    [_introduceBtn setTitle:@"景区介绍" forState:UIControlStateNormal];
    [self.contentView addSubview:_introduceBtn];
    
}



@end
